package com.wushi.codegen.base;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

public abstract class BaseControllor<T> {
	public abstract BaseService<T> getService();
	
	public abstract BaseEntity getEntity();
	public static String className=StringUtils.uncapitalize(BaseEntity.class.getName()); 
	
	@RequestMapping("/add")
	public void add(T t) {
		getService().add(t);
		
	}
	
	@RequestMapping("/update")
	public void update(T t) {
		getService().update(t);
	}
	
	@RequestMapping("/updateBySelective")
	public void updateBySelective(T t) {
		getService().updateBySelective(t);
	}
	
	@RequestMapping("/delete")
	public void delete(Object id) {
		getService().delete(id);
	}
	
	@RequestMapping("/queryCount")
	public int queryCount(Object paras) {
		return getService().queryCount(paras);
	}
	
	@RequestMapping("/queryList")
	public List<T> queryList(Object paras){
		return getService().queryList(paras);
	}


}
